#pragma once
#include "snake.h"
#include "food.h"
#include <memory>

class Game {
public:
    Game();
    void update();
    void render();
    bool isGameOver() const { return gameOver; }
    void reset();
    int getScore() const { return score; }

private:
    void handleInput();
    void checkCollisions();
    void renderGame();
    void renderGameOver();
    void renderUI();

    std::unique_ptr<Snake> snake;
    std::unique_ptr<Food> food;
    bool gameOver;
    int score;
    float accumulatedTime;
    float updateInterval;
};